Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tso: skip resetting leader when resetting tso allocator #8495

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Aug 6, 2024

What problem does this PR solve?

Issue Number: Ref #8477.

What is changed and how does it work?

This PR supports skipping resetting the leadership when resetting the TSO allocator which will be used in the next PR. The PD might reset the TSO allocator leader and let the TSO service serve TSO requests. In this case, the PD leader should not be affected.

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 6, 2024
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.35%. Comparing base (c8ad186) to head (88bf631).
Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8495   +/-   ##
=======================================
  Coverage   77.35%   77.35%           
=======================================
  Files         472      472           
  Lines       61782    61798   +16     
=======================================
+ Hits        47789    47805   +16     
+ Misses      10432    10431    -1     
- Partials     3561     3562    +1     
Flag Coverage Δ
unittests 77.35% <88.88%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -1132,13 +1132,13 @@ func (am *AllocatorManager) HandleRequest(ctx context.Context, dcLocation string

// ResetAllocatorGroup will reset the allocator's leadership and TSO initialized in memory.
// It usually should be called before re-triggering an Allocator leader campaign.
func (am *AllocatorManager) ResetAllocatorGroup(dcLocation string) {
func (am *AllocatorManager) ResetAllocatorGroup(dcLocation string, skipResetLeader bool) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is skipResetLeader true?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add a PR description.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Aug 7, 2024
@@ -181,6 +181,9 @@ func (m *GroupManager) allocNodesToAllKeyspaceGroups(ctx context.Context) {
log.Info("the raftcluster is closed, stop to alloc nodes to all keyspace groups")
return
case <-ticker.C:
if m.nodesBalancer.Len() == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetNodesCount() is better

Signed-off-by: Ryan Leung <[email protected]>
Copy link
Contributor

ti-chi-bot bot commented Aug 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lhy1024, okJiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 8, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-07 06:09:16.417837222 +0000 UTC m=+418686.284936308: ☑️ agreed by lhy1024.
  • 2024-08-08 13:54:19.548667289 +0000 UTC m=+532989.415766377: ☑️ agreed by okJiang.

Copy link
Contributor

ti-chi-bot bot commented Aug 8, 2024

@rleungx: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 8bd348e into tikv:master Aug 9, 2024
21 checks passed
@rleungx rleungx deleted the skip-reset-leader branch August 9, 2024 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants